package com.itheima.threadatom2;

public class AtomThreadDemo implements  Runnable{
    private static Object lock = new Object();
    private int count = 0;
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            synchronized (lock) {
                count++;
                System.out.println("已经送了" + count + "个冰激凌");
            }
        }
    }
}
